#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2024/11/14 9:55
# @Author : XXX
# @Site : 
# @File : FIFO_Stack.py
# @Software: PyCharm
from collections import deque


class FIFO_Stack:
    def __init__(self):
        self.stack = deque(maxlen=2)  # 使用deque，并设置最大长度为3

    def data_to_stack(self, data):
        self.stack.append(data)

    def stack_display(self):
        myLogger.info(list(self.stack)[0])
        myLogger.info(list(self.stack)[-1])

    def transaction_data(self):
        self.data_0 = list(self.stack)[0]
        self.data_1 = list(self.stack)[-1]
        return self.data_0, self.data_1